package com.icss.feign;

import com.icss.feign.model.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/*用户服务*/
@FeignClient(value = "user-service")
public interface UserService {

    @PostMapping("/user/register")
    boolean register(@RequestBody User user);

    @PostMapping("/user/account")
    User queryByAccount(@RequestParam("account") String account);

    @PostMapping("/user/update")
    void updateUserState(@RequestParam("userId") int userId);

    @PostMapping(value = "/user/upsert/session")
    boolean saveSession(@RequestBody User user);

    @PostMapping("/user/query/session")
    User querySession(@RequestParam("userId") int userId);
}
